<!--
 * @Description: Description
 * @Author: laoyuan
 * @Date: 2023-04-18 13:07:59
-->
<template>
  <div class="dialog-box">
    <div class="title">{{ title }}</div>
    <div class="content">{{ content }}</div>
    <div class="control">
      <div class="btn confirm-btn" @click="confirmCallback">{{ confirmText }}</div>
      <div class="btn cancel-btn" @click="cancelCallback">{{ cancelText }}</div>
    </div>
  </div>
</template>
<script setup lang="ts">
  type Props = {
    title: string;
    content: string;
    confirmText: string;
    cancelText: string;
    confirmCallback: () => void;
    cancelCallback: () => void;
  };
  withDefaults(defineProps<Props>(), {
    confirmText: '确定',
    cancelText: '取消',
  });
</script>
<style lang="scss" scoped>
  .dialog-box {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 20;
    min-width: 100%;
    min-height: 180px;
    background-color: #fff;
    border-radius: 8px 8px 0 0;
    .title {
      font-size: 16px;
    }
    .content {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 50px;
      font-size: 14px;
      text-align: center;
    }
    .control {
      display: flex;
      justify-content: center;
      margin-top: 40px;
    }
    .btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100px;
      height: 45px;
    }
    .confirm-btn {
      color: #fff;
      background-color: rgb(9 110 233 / 91.6%);
    }
    .cancel-btn {
      margin-left: 20px;
      color: #333;
      background-color: rgb(216 222 230 / 91.6%);
    }
  }
</style>
